const pageService = require('../services/pageService');

exports.getPage = async (req, res) => {
  const data = await pageService.readPageData();
  res.json(data);
};

exports.savePage = async (req, res) => {
  const err = await pageService.writePageData(req.body);
  if (err) {
    return res.status(500).json({ success: false, message: '保存失败' });
  }
  res.json({ success: true });
}; 